/*
*  Copyright 2019-2023 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.sql.Timestamp;

/**
* @description /
* @author shitou
* @date 2024-06-02
**/
@Data
@TableName("userquestionlog")
public class Userquestionlog implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "id")
    private Long id;

    @ApiModelProperty(value = "教材id")
    private Long teachid;

    @ApiModelProperty(value = "教材章节id")
    private Long teachchapterid;

    @ApiModelProperty(value = "教材小节id")
    private Long teachsubsectionid;

    @ApiModelProperty(value = "小节组件id")
    private Long subsectionpluginsid;

    @ApiModelProperty(value = "习题集组件id")
    private Long subsectionExerciseSetId;

    @ApiModelProperty(value = "习题集id")
    private Long exercisesetid;


    @ApiModelProperty(value = "是否正确")
    private Integer istrue;

    @ApiModelProperty(value = "答题内容")
    @NotBlank(message = "答题内容不能为空")
    private String content;

    @ApiModelProperty(value = "lastupdatetime")
    private Integer lastupdatetime;

    @ApiModelProperty(value = "答题记录表")
    private Long userexercisesetlogid;

    @ApiModelProperty(value = "组件|课程")
    private Integer type;

    @ApiModelProperty(value = "课程")
    private Long courseid;

    @ApiModelProperty(value = "questionid")
    private Long questionid;

    @ApiModelProperty(value = "userid")
    private Long userid;

    @ApiModelProperty(value = "score")
    private String score;

    @ApiModelProperty(value = "createtime")
    private String createtime;

    @ApiModelProperty(value = "questiontype")
    private Integer questiontype;

    private String path;

//    @TableField(exist = false)
//    private Long subsectionexercisesetid;
    public void copy(Userquestionlog source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
